<% if @reply.errors.blank? %>
  if($("#replies").length == 0){
    location.href = location.href;
  }
  else {
    $("#replies").append('<%= escape_javascript(render("reply", :reply => @reply, :reply_counter => @topic.replies_count - 1, :display_edit => true)) %>')
    .find(".total").replaceWith('<%= escape_javascript(render :partial => "topics/translation/topic_reply_statics", :locals => { :topic => @topic }) %>');
    $("#replies .reply a.edit:last").css("display","inline-block");
    Topics.replyCallback(1,'<%= escape_javascript(@msg) %>');
  }
<% else %>
  Topics.replyCallback(0,'<%= escape_javascript(@msg) %>');
<% end %>
